var log4js = require('log4js')

log4js.configure({
  appenders: {
    console: {
      type: 'stdout'
    }, //控制台输出
    log_file: {
      type: 'file',
      filename: './logs/log_file/file.log',
      maxLogSize: 104800,
      backups: 100
    },
    log_date: {
      type: 'dateFile',
      filename: './logs/log_date/date',
      alwaysIncludePattern: true,
      pattern: '-yyyy-MM-dd-hh.log'
    }
  },
  replaceConsole: true,
  categories: {
    default: { appenders: ['log_file', 'log_date', 'console'], level: 'info' },
    debug: { appenders: ['log_file', 'log_date'], level: 'ALL' }
  }
})

exports = module.exports = log4js
